package com.zhiwang.xiaoqu.di.module

import com.zhiwang.xiaoqu.di.annotation.ActivityScope
import com.zhiwang.xiaoqu.ui.fragment.MyFragment
import com.zhiwang.xiaoqu.ui.main.MoneyFragment
import com.zhiwang.xiaoqu.ui.withdraw.AliWithdrawFragment
import com.zhiwang.xiaoqu.ui.withdraw.WeiXinFragment
import dagger.Module
import dagger.Provides
import dagger.android.ContributesAndroidInjector
import javax.inject.Named

@Module
abstract class MainFragmentBindModule {

    @ContributesAndroidInjector
    abstract fun bindMyFragment(): MyFragment

    @ContributesAndroidInjector(modules = [MoneyFragmentModule::class])
    abstract fun bindMoneyFragment(): MoneyFragment
}


@Module
class MoneyFragmentModule {

    @Provides
    @Named("count_time")
    fun provideRedPacketCountTime(): Int = 3
}


@Module
abstract class WithDrawFragmentModule {

    @ContributesAndroidInjector
    abstract fun weixinFragment(): WeiXinFragment

    @ContributesAndroidInjector
    abstract fun aliFragment(): AliWithdrawFragment
}
